package lab03.test04;

import java.io.*;

public class Test04 {

    public static void main(String[] args) {

        try {
            FileInputStream reader =
                    new FileInputStream("E:\\hello.txt");

            File file = new File("E:\\test1.txt");
       if (!file.exists()){

           file.createNewFile();
       }

            FileOutputStream writer =
                    new FileOutputStream("E:\\test1.txt");

               int i;
               while ((i = reader.read() )!= -1){

                   writer.write(i);
            }

            reader.close();
            writer.close();

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
